from pydantic import BaseModel, Field
from typing import Optional


class DictItemCreate(BaseModel):
    dict_key: str = Field(..., description="字典键")
    dict_value: str = Field(..., description="字典值")
    dict_type: str = Field(..., description="字典类型编码")
    category: Optional[str] = Field(None, description="分类")
    score: Optional[int] = Field(0, description="得分")
    options: Optional[str] = Field("N", description="选项")
    sort_order: Optional[int] = Field(0, description="排序")


class DictItemUpdate(BaseModel):
    dict_key: Optional[str] = Field(None, description="字典键")
    dict_value: Optional[str] = Field(None, description="字典值")
    dict_type: Optional[str] = Field(None, description="字典类型编码")
    category: Optional[str] = Field(None, description="分类")
    score: Optional[int] = Field(None, description="得分")
    options: Optional[str] = Field(None, description="选项")
    sort_order: Optional[int] = Field(None, description="排序")